package com.itqian.user.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 用户地址表
 * </p>
 *
 * @author shishuqian
 * @since 2022-02-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class UserAddress implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * 配送地址id
     */
    @TableId(value = "address_id", type = IdType.AUTO)
    private Integer addressId;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 收货人姓名
     */
    @NotEmpty
    private String name;

    /**
     * 收货人手机号
     */
    @NotEmpty
    private String phone;

    /**
     * 用户的配送地址
     */
    @NotEmpty
    private String address;

    /**
     * 是否为默认地址
     */
    @NotNull
    private Boolean defaultAddress;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}
